﻿using Core.DataAccess.Model.Project.Comment;
using Core.Framework.Model.Common;
using System;
using System.Collections.Generic;
using System.Text;
using Core.IBusiness.IComment.Model;

namespace Core.IBusiness.IComment
{
    /// <summary>
    /// 
    /// </summary>
    public interface IComment : ICommentReply,ICommentAttribute
    {

        /// <summary>
        /// 评论相关操作
        /// 写入发生
        /// - 初始化[Fabulous]  [Follow]
        /// </summary>
        /// <param name="model">数据模型</param>
        /// <param name="sqlExecType">操作类型</param>
        /// <param name="clientInfo">客户端Token</param>
        /// <returns></returns>
        MethodResult<int> CommentExec(CommentList model, SqlExecType sqlExecType, ApiClientInfo clientInfo);


        /// <summary>
        /// 查询文章内容的相关评论
        /// </summary>
        /// <param name="infoKey">信息关键字</param>
        /// <param name="isGetReply">是否查询回复信息</param>
        /// <param name="pagination">分页参数</param>
        /// <param name="attributeEnums">获取属性，默认全查</param>
        /// <param name="type">
        /// 自定义分类，
        /// 用于区分不同模块的评论内容
        /// </param>
        /// <returns></returns>
        MethodResult<List<CommentList>> GetComments(int infoKey, bool isGetReply, Pagination pagination, List<CommentAttributeEnum> attributeEnums = null, string type = null);


        /// <summary>
        /// 点赞
        /// </summary>
        /// <param name="infoKey">信息关键字</param>
        /// <param name="userKey">用户关键字</param>
        /// <param name="clientToken">客户端Token</param>
        /// <returns></returns>
        MethodResult<int> CommentStar(int infoKey, int userKey, string clientToken);

        /// <summary>
        /// 取消点赞
        /// </summary>
        /// <param name="infoKey">信息关键字</param>
        /// <param name="userKey">用户关键字</param>
        /// <param name="clientToken">客户端Token</param>
        /// <returns></returns>
        MethodResult<int> CommentUnStar(int infoKey, int userKey, string clientToken);

    }
}
